<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <title>学生更新系统</title>

    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
</head>

<body>
<div class="container">
    <h1>学生更新系统</h1>
    <hr>
    <h2>更新学生</h2>

    <form action="#" th:action="@{/saveStudent}" th:object="${student}" method="POST">
        <!-- Add hidden form field to handle update -->
        <input type="hidden" th:field="*{id}" />

        <input type="text" th:field="*{stuName}" class="form-control mb-4 col-4">

        <input type="text" th:field="*{stuId}" class="form-control mb-4 col-4">

        <input type="text" th:field="*{stuSex}" class="form-control mb-4 col-4">

        <input type="text" th:field="*{stuAge}" class="form-control mb-4 col-4">

        <button type="submit" class="btn btn-info col-2"> 点击更新学生</button>
    </form>

    <hr>

    <a th:href="@{/}"> 返回到学生列表</a>
</div>
</body>

</html>